package fun.lifepoem.blog.service;

import fun.lifepoem.blog.domain.dto.ArticleListConditionDTO;
import fun.lifepoem.blog.domain.vo.ArticleVO;
import fun.lifepoem.blog.mapper.ArticleMapper;
import fun.lifepoem.blog.mapper.ArticleTagMapper;
import fun.lifepoem.blog.mapper.TagMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Yiwyn
 * @create 2022/9/17 21:04
 */
@Service
@Slf4j
public class ArticleService {


    @Autowired
    private TagMapper tagMapper;

    @Autowired
    private ArticleMapper articleMapper;

    @Autowired
    private ArticleTagMapper articleTagMapper;


    public List<ArticleVO> getArticleList(ArticleListConditionDTO conditionDTO) {
        List<ArticleVO> articleVOS = articleMapper.selectVOList(conditionDTO);
        return articleVOS;
    }

    public ArticleVO getArticleById(String id) {
        return articleMapper.getArticleById(id);
    }

}
